package com.guoxin.concurrentcy.chapter11;

public class ThreadException {

    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            try {
                Thread.sleep(1000);
                int i = 4 / 0;
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        t.setUncaughtExceptionHandler((t1, e) -> {
            System.out.println(e);
            System.out.println(t1);
        });
        t.start();
    }
}
